﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Utils.Extention;
#region Version Info
/* ========================================================================
* 【本页面功能概述】
*
* 作者：wangjianfeng 创建时间：2012/9/22 23:28:59
* 文件名：HotAttention.cs
*
* 修改者： 时间：
* 修改说明：
* ========================================================================
*/
#endregion
namespace ChinaLeg.Web
{
    public partial class HotAttention : System.Web.UI.Page
    {
        protected string title, description, keyWrods,bgImage,adScroll;
        
        protected int catid;

        protected string href16, desc16, href17, desc17, href15, desc15;

        protected void Page_Load(object sender, EventArgs e)
        {
            catid = 2;
            if (!this.IsPostBack)
            {
                ChinaLeg.Cache.Category.Instance.GetModel(catid, out title, out  keyWrods, out  description, out  bgImage);
                Top1.CatId = catid;
                Top1.BgImage = bgImage;
                adScroll = ChinaLeg.Cache.ScrollFocusPicture.Instance.GetList(catid);

                Right1.Height = 690;
                Right1.Size = 2;
                List<ChinaLeg.Model.News> list = ChinaLeg.BLL.News.Instance.GetList(" and ListCommend=1 and catid=15", 5, "ShowOrder", 0);
                if (list.Count > 0)
                {
                    href15 = ChinaLeg.Web.Lib.WebLinks.GetNewsLinks(list[0].Id);
                    desc15 = list[0].Description.SubStringByBytes(150, false);
                }
                rpt15.DataSource = list;
                rpt15.DataBind();

                list = ChinaLeg.BLL.News.Instance.GetList(" and ListCommend=1 and catid=16", 6, "ShowOrder", 0);
                if (list.Count > 0)
                {
                    href16 = ChinaLeg.Web.Lib.WebLinks.GetNewsLinks(list[0].Id);
                    desc16 =  list[0].Description.SubStringByBytes(94,false);
                }
                rpt16.DataSource = list;
                rpt16.DataBind();

                list = ChinaLeg.BLL.News.Instance.GetList(" and ListCommend=1 and catid=17", 6, "ShowOrder", 0);
                if (list.Count > 0)
                {
                    href17 = ChinaLeg.Web.Lib.WebLinks.GetNewsLinks(list[0].Id);
                    desc17 = list[0].Description.SubStringByBytes(94,false);
                }
                rpt17.DataSource =  list;
                rpt17.DataBind();
            }

        }
    }
}